<!DOCTYPE html>
<html>
<head>
</head>
<body onload="runTest();" style="width:2000px;height:2000px;">
<div>This test is successful if event.clientX/Y are consistent with the generated input.</div>
<div id="result"></div>
<script>
function touched(e) {
    document.getElementById("result").innerText = e.targetTouches[0].clientX + ', ' + e.targetTouches[0].clientY;
    if (window.testRunner)
        testRunner.notifyDone()
}

function runTest() {
    // Scroll before scaling so we scroll the layout viewport rather than the visual.
    window.scrollTo(100,100);
    if (window.internals)
        internals.setPageScaleFactor(2);

    if (window.testRunner) {
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
    }

    document.addEventListener("touchstart", touched, false);
    if (window.eventSender && window.internals) {
        eventSender.clearTouchPoints();
        eventSender.addTouchPoint(30, 70);
        eventSender.touchStart();
    } else
        debug("This test requires DumpRenderTree.");
}
</script>
</script>
</body>
</html>
